package com.zxd.threads.thread_pool.callable_task;

import java.util.concurrent.Callable;

/**
 * ClassName:FutureTaskCallable
 * Package:com.zxd.threads
 * 创建Callable的实现类，用于创建FutureTask线程任务对象
 * @Date:2023/9/25 16:40
 * @Author:zxde
 */
public class MyCallable implements Callable<String> {

    private int n;
    public MyCallable(int n){
        this.n = n;
    }


    @Override
    public String call() throws Exception {
        return Thread.currentThread().getName()+"线程计算出结果==>"+n*n;
    }
}
